<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button text="返回"></ion-back-button>
    </ion-buttons>
    <ion-title style="padding-left: 20%;">修改密码</ion-title>
  </ion-toolbar>
</ion-header>

<ion-content non-padding>
  <form>
    <ion-list>
      <!-- <ion-item>
        <ion-label position="floating">输入旧密码</ion-label>
        <ion-input required [(ngModel)]="oldpassword" name="oldpass" #oldpass="ngModel"
                   pattern="[0-9a-zA-Z]{6,12}"></ion-input>
      </ion-item>
      <ion-text [hidden]="isOldPassword" padding-start color="danger">您输入的旧密码不正确</ion-text>
      <ion-text [hidden]="!oldpass.errors.pattern" padding-start color="danger" *ngIf="oldpass.invalid && oldpass.touched">
        密码格式为6至12位的数字字母
      </ion-text> -->
      <ion-item>
        <ion-label position="floating">请输入新密码</ion-label>
        <ion-input type="password" required [(ngModel)]="newPassword" name="newpass"></ion-input>
      </ion-item>
      <!-- <ion-text [hidden]="!newpass.errors?.pattern" padding-start color="danger" *ngIf="newpass.invalid && newpass.touched">
        密码格式为6至12位的数字字母
      </ion-text> -->
      <ion-item>
        <ion-label position="floating">请再次核对密码</ion-label>
        <ion-input type="password" required [(ngModel)]="checkPassword" name="checkpass"></ion-input>
      </ion-item>
      <ion-text [hidden]="newPassword == checkPassword" padding-start color="danger">两次密码不一致</ion-text>
    </ion-list>
    <ion-button expand="block" (click)="onSave()">
      确定
    </ion-button>
  </form>
</ion-content>
